﻿using System;
using System.Linq;
using System.Reflection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.SqlSugarCore.DependencyInjection;
using Volo.Abp.SqlSugarCore.Repositories.DependencyInjection;
using Volo.Abp.SqlSugarCore.SqlSugarFactory;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class SqlSugarServiceCollectionExtensions
    {
        public static IServiceCollection AddSqlSugarRepositories(
            this IServiceCollection services, Assembly assem)
        {


            new SqlSugarCoreRepositoryRegistrar(services, assem).AddRepositories();

            RepositoryRegister.AddSugarRepository(services, assem);

            return services;
        }
    }
}
